package HDFS;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.junit.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

public class newMkdir {

    //创建一个文件夹
    @Test
    public void mkdir() throws URISyntaxException, IOException, InterruptedException {

        Configuration con = new Configuration();

        FileSystem fileSystem = FileSystem.get(new URI("hdfs://192.168.7.100:9000"),con,"root");

        fileSystem.mkdirs(new Path("/zhangwei"));

        fileSystem.close();
    }

}
